<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


    <script>
        function foo(a, b) {
            arguments[0] // 1
            arguments[1] // 2
        }
        foo(1, 2, 3);

        // foo.caller()



        // class Human {
        //     constructor(name, age, gender) {
        //         this.name = name;
        //         this.age = age;
        //         this.gender = gender;
        //     }
        //     eat() {
        //         console.log('干饭！');
        //     }
        //     talk(catName) {
        //         console.log(`我的小猫叫${catName}`);
        //     }
        // }
        // let zhangsanObj = new Human('zhangsan', 18, 'male');
        // zhangsanObj.eat();

        // class Cat {
        //     constructor(name) {
        //         this.name = name;
        //     }
        // }
        // let catObj = new Cat('李嵩涛【不要的】雷景翔');

        // zhangsanObj.talk(catObj.name);


        function Dog(name, age, gender) {
            return {
                type: 'dog',
                legs: 4,
                eyes: 2,
                name,
                age,
                gender,
                eat() {
                    console.log('干饭！');
                }
            }
        }
        // let obj = Dog('xiaohei', 2, 'male');
        // console.log(obj);

        let arr = [];

        for (let i = 0; i < 3; i++) {
            arr.push(Dog('xiaohei', 2, 'male'));
        }

        console.log(arr);


    </script>
</body>

</html>